<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\common\controller\Frontend;

/**
 * 课程分类
 */
class Classify extends Api
{
    protected $noNeedLogin = [''];

    protected $noNeedRight = '*';

    /**
     * 列表
     * @return void
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function lst()
    {

        $campus_id = $this->auth->getUser()['campus_id'];
        $where['campus_id'] = $campus_id;
        $model = new \app\common\model\Classify();
        $data = $model
            ->where($where)
            ->where("status", 1)
            ->order("weigh", "desc")
            ->select();
        $this->success("列表", $data);
    }

}